package com.nuyoah.service.impl;

import com.nuyoah.entity.NewsResource;
import com.nuyoah.mapper.NewsResourceMapper;
import com.nuyoah.service.NewsResourceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 存储数学竞赛和学习相关的资讯资源 服务实现类
 * </p>
 *
 * @author xyx
 * @since 2024-06-03
 */
@Service
public class NewsResourceServiceImpl extends ServiceImpl<NewsResourceMapper, NewsResource> implements NewsResourceService {

    @Override
    public void addNewsResource(NewsResource newsResource) {
        this.save(newsResource);
    }

    @Override
    public void deleteNewsResource(Integer id) {
        this.removeById(id);
    }


    @Override
    public void updateNewsResource(NewsResource newsResource) {
        this.updateById(newsResource);
    }

    @Override
    public List<NewsResource> queryNewsResource() {
        return this.list();
    }

    @Override
    public List<NewsResource> getConsultation() {
        return this.baseMapper.getConsultation();
    }

    @Override
    public List<NewsResource> getCompetition() {
        return this.baseMapper.getCompetition();
    }
}
